* Replication file for "The formateur�s bonus in European constitutional monarchies, 1901-1999"

* Citation for dataset: 
* Cox, Gary W. and Osnat Akirav. 2018. Replication Data for: "The formateur�s bonus in European constitutional monarchies, 1901-1999". Version 1. Distributed by Cambridge, MA: Harvard Dataverse. doi:10.7910/DVN/BUEHYT.

* Table of Contents:
* 1. Variable labels for "formateurs1.txt".
* 2. Replication code for analysis performed in STATA.
* 	MAIN MODEL, Figure 1, parrallel trends
* 3. Replication code for descriptive tables and appendix
*	Sample 1, Table 2, Table 3, Table 4, controlling for PR


* Analysis in STATA using file named "lsq_formateurs.txt".
* data have one obs per country-year with gaps (when no formateur formed a govt).
* The file "formateurs2.txt" provides the raw data.


* Variable labels for "lsq_formateurs.txt"
* country = NULL
* war = 1 if this was a wartime cabinet
* overrep = share_partisans - share_seats
* investiture = NULL
* strong_nominator = 1 if nominator has power and is directly involved in gov formation
* year = nULL
* cid = group(country)
* meanover = NULL
* region = 1 if nordic, 2 if benelux
* monarchy = 1 if monarchy throughtout the century
* mrbonus = mean formateur bonus in region-year
* devrbonus = mean formateur bonus in country-year, as deviation from region-year
* yr_change = yr in which HoS first constrained
* yrrel = year - yr_change
* m2bonus = mean formateur bonus in monarchies this year
* dev2bonus = mean formateur bonus in this country, rel to mean in monarchies this year




* Begin analysis
* if multiple formateurs in a give country-year, then meanover gives the average overrepresentation of the formateurs in that c-y
sort cid year
tsset cid year

* All countries that began as constitutional monarchies
* MAIN MODEL / fe
* All cases that began with a monarch
xtreg meanover I.year strong_nominator war invest if monarchy==1,fe vce(cl cid)
xtreg meanover I.year strong_nominator war invest if monarchy==1,re vce(cl cid)

* Figure 1 / showing the formateur's bonus relative to the bonus in the other monarchies in each year, with years rescaled relative to year of reform
* calculate deviations only for years in which at least two governments form
binscatter dev2bonus yrrel if monarchy&meanover!=mrbonus,rd(0) ytitle("Deviation") xtitle("Year relative to year of reform")


* parallel trends?
regress dev2bonus yrrel if country=="Belgium"&yrrel>-30&yrrel<0&meanover!=mrbonus
regress dev2bonus yrrel if country=="Denmark"&yrrel>-30&yrrel<0&meanover!=mrbonus
regress dev2bonus yrrel if country=="Netherlands"&yrrel>-30&yrrel<0&meanover!=mrbonus
regress dev2bonus yrrel if country=="Norway"&yrrel>-30&yrrel<0&meanover!=mrbonus
regress dev2bonus yrrel if country=="Sweden"&yrrel>-30&yrrel<0&meanover!=mrbonus
regress dev2bonus yrrel if country=="Iceland"&yrrel>-30&yrrel<0&meanover!=mrbonus

regress dev2bonus yrrel if monarchy&country!="Luxembourg"&yrrel>-30&yrrel<0&meanover!=mrbonus

* The results are similar using smoothed annual means, except that Belgium does show a decline prior to 1935
* calculate deviations using a smoothed estimate of the bonus in the monarchies
quietly lowess overrep year if monarchy,gen(estbonus)
gen devm = overrep - estbonus

regress devm yrrel if country=="Belgium"&yrrel>-30&yrrel<0
regress devm yrrel if country=="Denmark"&yrrel>-30&yrrel<0
regress devm yrrel if country=="Netherlands"&yrrel>-30&yrrel<0
regress devm yrrel if country=="Norway"&yrrel>-30&yrrel<0
regress devm yrrel if country=="Sweden"&yrrel>-30&yrrel<0
regress devm yrrel if country=="Iceland"&yrrel>-30&yrrel<0

regress devm yrrel if monarchy&country!="Luxembourg"&yrrel>-30&yrrel<0

* Code to create descriptive tables and appendix tables

* Sample 1:  all democratic years in West European constitutional monarchies
gen include1=0
replace include1=1 if party!="neutral"&ngovparties>1&bmr_dem==1
replace include1=0 if country=="Norway"&in_year<1905
replace include1=0 if country=="Finland"

gen formwar = formateur*war
gen formstrong=formateur*strong_nominator
gen forminv=formateur*investiture
gen formcon=formateur*confidence
gen formenp=formateur*enp

gen seatwar=share_seats*war
gen seatstrong=share_seats*strong_nominator
gen seatinv=share_seats*investiture
gen seatcon=share_seats*confidence
gen seatenp=share_seats*enp

gen yr_change=1935 if country=="Belgium"
replace yr_change=1953 if country=="Denmark"
replace yr_change=1941 if country=="Iceland"
replace yr_change=1951 if country=="Netherlands"
replace yr_change=1928 if country=="Norway"
replace yr_change=1974 if country=="Sweden"
gen yrrel=year - yr_change

egen cid = group(country)

* replace include1=0 if country=="Denmark"&cabinet=="Zahle-IIb"
* Zahle was no royalist.  Eventually the king dismissed him in a move seen as unconstitutional.

* Table 2
list country cabinet in_year if include1==1&in_year<1945&formateur==1

* Table 3 / pre-WWII regression / post-war
regress share_partisans share_seats formateur if include1==1&in_year<1945
regress share_partisans share_seats formateur if include1==1&in_year>=1945

* Appendix Tables 
* 5 countries that switch from strong to weak nominator
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include1==1&country=="Belgium"
lincom formateur+formstrong
regress share_partisans share_seats formateur  strong_nom seatstrong formstrong if include1==1&country=="Denmark"
lincom formateur+formstrong
regress share_partisans share_seats formateur  strong_nom seatstrong formstrong if include1==1&country=="Iceland"
lincom formateur+formstrong
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include1==1&country=="Netherlands"
lincom formateur+formstrong
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include1==1&country=="Norway"
lincom formateur+formstrong
* Denmark without Zahle IIb
regress share_partisans share_seats formateur  strong_nom seatstrong formstrong if include1==1&country=="Denmark"&cabinet!="Zahle-IIb"
lincom formateur+formstrong

* Table 4  / pooling all countries
* Model 1
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include1==1

* Model 2 / controlling for war cabinets
regress share_partisans share_seats formateur war strong_nom seatstrong seatwar formwar formstrong if include1==1

* Model 3 / also controlling for investiture, confidence & bargaining complexity
regress share_partisans share_seats formateur strong_nom seatstrong formstrong investiture seatinv forminv confidence seatcon formcon enp seatenp formenp if include1==1

* Removing one country at a time / Model 1
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include1==1&country!="Belgium"
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include1==1&country!="Denmark"
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include1==1&country!="Iceland"
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include1==1&country!="Luxembourg"
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include1==1&country!="Netherlands"
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include1==1&country!="Norway"
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include1==1&country!="Sweden"

* controlling for introduction of PR:  use the variable PR = (year>=year_pr) and interactions with share_seats and formateur...  No effect

* Removing one party from each cabinet
gsort country in_year cabinet party
gen include4=include1
replace include4=0 if cabinet!=cabinet[_n-1]
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include4==1
lincom formateur+formstrong

sort cabinet party
by cabinet: gen ui = floor((ngov)*runiform() + 1)
egen seqno = seq(),by(cabinet)
gen include5=include1
replace include5=0 if seqno == ui
regress share_partisans share_seats formateur strong_nom seatstrong formstrong if include5==1
lincom formateur+formstrong


